package com.adams.access.db.bean;

import java.io.Serializable;

import javax.persistence.Column;

/**
 * 
 * 
 * File Name : DicColumnPK.java
 * 
 * @Description : 联合主键
 */
public class DicColumnPK implements Serializable
{
	private static final long serialVersionUID = 1L;

	private String tablecode;// 表编码

	private String columncode;// 字段编码

	@Column(name = "TABLECODE", length = 64)
	public String getTablecode()
	{
		return tablecode;
	}

	public void setTablecode(String tablecode)
	{
		this.tablecode = tablecode;
	}

	@Column(name = "COLUMNCODE", length = 64)
	public String getColumncode()
	{
		return columncode;
	}

	public void setColumncode(String columncode)
	{
		this.columncode = columncode;
	}

	public DicColumnPK()
	{
		super();
	}

	public DicColumnPK(String tablecode, String columncode)
	{
		super();
		this.tablecode = tablecode;
		this.columncode = columncode;
	}

	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((columncode == null) ? 0 : columncode.hashCode());
		result = prime * result
				+ ((tablecode == null) ? 0 : tablecode.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DicColumnPK other = (DicColumnPK) obj;
		if (columncode == null)
		{
			if (other.columncode != null)
				return false;
		} else if (!columncode.equals(other.columncode))
			return false;
		if (tablecode == null)
		{
			if (other.tablecode != null)
				return false;
		} else if (!tablecode.equals(other.tablecode))
			return false;
		return true;
	}

}
